#ifndef __BSP_FUSI_H__
#define __BSP_FUSI_H__

#include <stdint.h>
#include "usart.h"
// #include "dma.h"
//=====================================================================================================

/*-----------------selections
--------------------------------------------------------
@brief:
*/


/*-----------------settings
--------------------------------------------------------
@brief:
*/
extern UART_HandleTypeDef huart1;
#define UART_HANDLE (UART_HandleTypeDef*)(&huart1)

extern DMA_HandleTypeDef hdma_usart1_rx;
#define DMA_UART_RX (DMA_HandleTypeDef *)(&hdma_usart1_rx)

/*-----------------definitions
--------------------------------------------------------
@brief:
*/
#define FUSI_IBUS_RX_BUF_NUM 64u
#define FUSI_RC_FRAME_LENGTH 32u
#define FUSI_IBUS_USER_CHANNELS 6u
#define FUSI_IBUS_HAND 0x20
#define FUSI_IBUS_COMMAND 0x40
#define FUSI_CH_VALUE_MIN ((uint16_t)1000u)
#define FUSI_CH_VALUE_OFFSET ((uint16_t)1500u)
#define FUSI_CH_VALUE_MAX ((uint16_t)2000u)

//=====================================================================================================

/*-----------------params
--------------------------------------------------------
@brief:
*/
typedef struct rc_ctrl
{
    struct
    {
        uint16_t LX;
        uint16_t LY;
        uint16_t RX;
        uint16_t RY;
        int8_t SWA;
        int8_t SWB;
        int8_t SWC;
        int8_t SWD;
        //16+8+8(10通道)=32
    } fusi;

}  rc_ctrl_t;
// __attribute__((packed))
//
const rc_ctrl_t *
p_GetFusi_Data(void);

/*-----------------functions
--------------------------------------------------------
@brief:
*/
//
void Remote_Init(void);

/*-----------------XXX API_h
--------------------------------------------------------
@brief:
*/
//


/*------------------------end-------------------------*/
#endif